package cat.controller;
					import java.util.Date;
import java.util.List;

import javax.annotation.Resource;
					import javax.servlet.http.HttpServletRequest;
					import org.springframework.stereotype.Controller;
					import org.springframework.web.bind.annotation.RequestMapping;

import cat.entity.Article;
import cat.entity.Comment;
import cat.entity.User;
import cat.service.ArticleService;
import cat.service.CommentService;
import cat.service.UserService;
					
					@Controller
					public class AdminController {
						@Resource
						private UserService userService;
						
						@Resource
						private ArticleService articleService;
						
						@Resource
						private CommentService commentService;   //加上这个
						
					
						@RequestMapping("/loginVerify")
						public String login(HttpServletRequest request)
						{
					
							
							//首页要显示最新的5条文章信息列表
							List<Article> articleList = articleService.listRecentAritle(5);
							request.setAttribute("articleList", articleList);
							
							//首页要显示最新的5条评论信息列表
							java.util.List<Comment> commentList = commentService.listRecentComment(5);
						
							request.setAttribute("commentList", commentList);
							
							return "/index"; 
						}
					}